<div>
	<h2>Add Top Products</h2>
	<div class="content">
		<div class="form500">
			<p>The list displays only products belonging to the selected category. Products, which were already added to the list of the category top products are hidden.</p>
			
			<?= Phpr_Form::openTag(array('id'=>$this->listGetFormId(), 'class'=>'relative')) ?>
				<div class="formFlash"></div>

				<div class="embeddedList search500">
					<?
						$listColumns = array('name', 'sku', 'price');
					?>
					
					<?= $this->listRender(array(
						'list_model_class'=>'Shop_Product',
						'list_columns'=>$listColumns,
						'list_custom_body_cells'=>PATH_APP.'/phproad/modules/db/behaviors/db_listbehavior/partials/_list_body_cb.htm',
						'list_custom_head_cells'=>PATH_APP.'/phproad/modules/db/behaviors/db_listbehavior/partials/_list_head_cb.htm',
						'list_record_url'=>null,
						'list_search_enabled' => true,
						'list_no_setup_link'=>true,
						'list_search_fields'=> array('@name', 'sku'),
						'list_search_prompt'=>'find products by name or SKU',
						'list_no_form'=>true,
						'list_custom_prepare_func'=>'prepare_add_top_products_list',
						'list_items_per_page'=>10,
						'list_no_pagination'=>false,
						'list_no_sorting'=>false,
						'list_name'=>'add_top_products_list',
						'list_no_data_message'=>'There are no products in this category or all category products were already added to the top list.'
					)) ?>
				</div>

				<?= backend_ajax_button('Add selected products', 'manage_top_products_onAddProducts', array(), "
					loadIndicator: {show: true, hideOnSuccess: true, injectInElement: true},
					extraFields: {'top_product_post_mode': 1},
					update: 'multi',
					onAfterUpdate: function(){
						make_top_sortable();
						realignPopups();
					}
				") ?>
				<?= backend_button('Close', array('onclick'=>'return cancelPopup()')) ?>
			
				<div class="clear"></div>
				<input type="hidden" name="add_top_product_mode" value="1"/>
			</form>
		</div>
	</div>
</div>